package org.bee.tl.ext;

import java.io.IOException;
import java.io.Writer;

import org.bee.tl.core.Context;
import org.bee.tl.core.Function;

public class Print implements Function {

	@Override
	public String call(Object[] paras, Context ctx) {
		Object o = paras[0];
		Writer w = (Writer) ctx.getVar("__pw");
		if (o != null) {
			try {
				w.write(o.toString());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return "";

	}

}
